import type { RouteRecordRaw } from 'vue-router'
import AboutList from '@/views/aboutList/index.vue'
import CompanyIntroduction from '@/views/aboutList/CompanyIntroduction.vue'
import Honor from '@/views/aboutList/Honor.vue'
import AboutInfo from '@/views/aboutList/Info.vue'
import HonorInfo from '@/views/aboutList/HonorInfo.vue'
import ProductList from '@/views/productList/index.vue'
import EventHonor from '@/views/productList/eventHonor/index.vue'
import ReportDeatil from '@/views/productList/eventHonor/ReportDeatil.vue'
import Brand from '@/views/productList/Brand.vue'
import FinishedProductList from '@/views/FinishedProductList.vue'
import NewsList from '@/views/news/index.vue'
import ActivityAlert from '@/views/news/ActivityAlert.vue'
import JobList from '@/views/jobList/index.vue'
import TalentRecruitment from '@/views/jobList/TalentRecruitment.vue'
import TalentInfo from '@/views/jobList/TalentInfo.vue'
import Contact from '@/views/Contact.vue'

/**
 * 路由配置
 * @description 所有路由都在这里集中管理
 */
const routes: RouteRecordRaw[] = [
  /* 默认 */
  {
    path: '',
    redirect: '/home',
  },
  /* 首页 */
  {
    path: '/home',
    name: 'home',
    meta: {
      title: 'Home',
    },
    children: [
      {
        path: '/home',
        component: () => import('@/views/home.vue'),
      },
    ],
  },
  /* 关于我们 */
  {
    path: '/about',
    name: 'about',
    component: AboutList,
    children: [
      {
        path: '/company-introduction',
        name: 'companyIntroduction',
        component: CompanyIntroduction,
      },
      {
        path: '/honor',
        name: 'honor',
        component: Honor,
      },
      {
        path: '/about-info',
        name: 'aboutInfo',
        component: AboutInfo,
      },
      {
        path: '/honor-info',
        name: 'honorInfo',
        component: HonorInfo,
      },
    ],
  },
  /* 产品展示 */
  {
    path: '/product',
    name: 'product',
    component: ProductList,
    children: [
      {
        path: '/event-honor',
        name: 'eventHonor',
        component: EventHonor,
      },
      {
        path: '/report-info',
        name: 'reportInfo',
        component: ReportDeatil,
      },
      {
        path: '/brand',
        name: 'brand',
        component: Brand,
      },
    ],
  },
  /* 成品展示 */
  {
    path: '/finished-product-list',
    name: 'finishedProduct',
    component: FinishedProductList,
  },
  /* 新闻动态 */
  {
    path: '/news',
    name: 'news',
    component: NewsList,
    children: [
      {
        path: '/activity-alert',
        name: 'activityAlert',
        component: ActivityAlert,
      },
    ],
  },
  /* 人才招聘 */
  {
    path: '/job',
    name: 'job',
    component: JobList,
    children: [
      {
        path: '/talent-recruitment',
        name: 'talentRecruitment',
        component: TalentRecruitment,
      },
      {
        path: '/talent-info',
        name: 'talentInfo',
        component: TalentInfo,
      },
    ],
  },
  /* 联系我们 */
  {
    path: '/contact',
    name: 'contact',
    component: Contact,
  },
  /**
   * 子路由示例
   */
  {
    path: '/foo',
    name: 'foo',
    component: () => import('@/components/TransferStation.vue'),
    meta: {
      title: 'Foo',
    },
    redirect: {
      name: 'bar',
    },
    children: [
      {
        path: 'bar',
        name: 'bar',
        component: () => import('@/views/foo/bar.vue'),
        meta: {
          title: 'Bar',
        },
      },
    ],
  },
]

export default routes
